$(function() {
			queryUser();
		});
function clicksss(empno) {
	$.ajax({
		url:"del?id="+empno,
		type:'get',
		success:function (res) {
           alert(res);
			queryUser();
		}
	})
}


//查询所有user
function queryUser() {
	
	$("#table_tbody").replaceWith("<tbody id=\"table_tbody\"></tbody>");

	$.post("queryAll", null, function(data, stuct) {
		if (data && data != "null") {
			

			$.each(data, function(i, data) {

				$("#table_tbody").append("<tr>" +
								"<td>"+data.ename+"</td>" +
								"<td>"+data.job+"</td>" +
								"<td>"+data.mgr+"</td>" +
								"<td>"+data.hiredate+"</td>" +
					"<td>"+data.sal+"</td>" +
					"<td>"+data.comm+"</td>" +
					"<td>"+data.dname+"</td>" +
								"<td><a href=\"manager/updataUser.jsp?id="+data.empno+"\">修改</a>&nbsp;&nbsp;&nbsp;" +
										"<a href='javascript:void(0)' onclick='clicksss("+data.empno+")' href=\"del?id="+data.empno+"\">删除</a></td></tr>");
						});

		} else {

			alert("你输入的用户名与密码不匹配，请重新输入！");
		}

	},"json");
}